package com.ruoyi.web.controller.monitor;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.vo.MongoLogSearchVo;
import com.ruoyi.system.service.IMongoLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.parameters.P;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.LinkedHashMap;
import java.util.List;

@RequestMapping("/crm/trackLog")
@RestController
public class MongLogController extends BaseController {
    @Resource
    private IMongoLogService mongoLogService;

    @PreAuthorize("@ss.hasPermi('crm:track:list')")
    @GetMapping("/list")
    public TableDataInfo list(MongoLogSearchVo searchVo){
        startPage();
        List<LinkedHashMap> list = mongoLogService.list(searchVo);
        return getDataTable(list);
    }
}
